<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <h4>{{title}}</h4>
        <p>{{msg}} </p>
        <div v-html="page"></div>
        <div v-text="page"></div>
        <p v-text="word"></p>

        <p>
            <input type="text" v-model="message">
            <span>{{message}} </span>
        </p>


        <div>
            <p>
                <input type="text" v-model="song">
                <!-- <span>{{song.split('').reverse().join('-')}} </span> -->
                <p>{{mysong}} </p>
        </div>

    </div>

</body>
<script>
    const vm = new Vue({
        data: {
            title: "模板语法 + 计算属性",
            msg: "daydayup",
            page: '<h2>从入门到精通</h2>',
            word: "hello",
            message: "每天解决小bug",
            song: "每天都要背面试题"
        },
        computed:{
            mysong(){
                return this.song.split('').reverse().join('') + " " + new Date().getSeconds()
            },
            myname(){
                return this.firstName + '&&' + this.lastName;
            },
            newname:{
                get(){
                    return this.firdx
                },
                set(v){
                    var names = v.split("==")
                    this.firstName == name[0]
                }
            }
        }
    }).$mount("#app")
</script>

</html>